﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

using System.ComponentModel;

namespace ETRobocon.RaceTraking.GameManagement
{
    /// <summary>
    /// Interaction logic for CheckMarkMgmtControl.xaml
    /// </summary>
    public partial class CheckMarkMgmtControl : UserControl
    {
        public CheckMarkMgmtControl()
        {
            InitializeComponent();
        }

        private void cbClearMark_Checked(object sender, RoutedEventArgs e)
        {
            cbClearMark.Foreground = new SolidColorBrush(Colors.Red);
        }

        private void cbClearMark_Unchecked(object sender, RoutedEventArgs e)
        {
            cbClearMark.Foreground = new SolidColorBrush(Colors.Black);
        }

        public string DisplayName
        {
            get { return cbClearMark.Content.ToString(); }
            set
            {
                cbClearMark.Content = value;
            }
        }

        public ClearMarkStatus ClearMarkStatus
        {
            get { return this.Resources["MyClearMarkStatus"] as ClearMarkStatus; }
        }

        public CheckBox MyCheckBox
        {
            get { return cbClearMark; }
        }
    }

    public class ClearMarkStatus : INotifyPropertyChanged
    {
        private int _order;
        public int Order
        {
            get { return _order; }
            set
            {
                _order = value;
                OnPropertyChanged("Order");
            }
        }

        private bool _clearedStatus;
        public bool ClearedStatus
        {
            set {
                _clearedStatus = value;
                OnPropertyChanged("ClearedStatus");
            }
            get { return _clearedStatus; }
        }

        private int _point;
        public int Point
        {
            set
            {
                _point = value;
                OnPropertyChanged("Point");
            }
            get { return _point; }
        }

        #region INotifyPropertyChanged Members

        public event PropertyChangedEventHandler PropertyChanged;

        #endregion

        protected void OnPropertyChanged(string name)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (handler != null)
            {
                handler(this, new PropertyChangedEventArgs(name));
            }
        }
    }
}
